/*

  main () process.
  
  history
   2012-10-31 zhubing   modified config file struct 

*/


#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>

#include "../serverframe/frame.h"

int on_data(DISPATCH_VARS)
{ 
  WRITE_DEBUG("enter on_data()");
  return 0;
}

int main (int argc , const char **argv)
{  
  struct srvcnf cnf;
  int n = getoption(argc,argv,&cnf);
  if (n != 0) return 1;
  
  printf("describe:%s\nport:%d\ndbserver:%s\ndbport:%d\n \
               dbuser:%s\ndbpass:%s\ndaemonmode:%d\nloglevel:%d\n \
               maxconns:%d\nworkthreadnum:%d\ndbname:%s\n",
               cnf.desc,cnf.port,cnf.dbserver,cnf.dbport,
               cnf.dbuser,cnf.dbpass,cnf.daemonmode,cnf.loglevel,
               cnf.maxconns,cnf.workthreadnum,cnf.default_database);

  

  n = start_server(&cnf,on_data);

  WRITE_DEBUG("%s terminated",cnf.desc);

  return 0;
}
